"""Conversion routine to put the prefix on all quotes tables"""

import tables
import sys
sys.path.insert(0, '../../vera')

def GogoFire(s):
    global H
    node = H.getNode(s)
    for c in node._v_children.itervalues():
        if not "quote" in c.name:
            n = c.name
            nn = "quote__"+n
            c._f_rename(newname=nn)
            print "Renamed %s/%s --> %s" % (s, n, nn)

H = tables.openFile("../../db/navala.h5", "r+")

ama = ["daily", "weekly", "monthly", "bimonthly", "quarterly", "semesterly", "yearly"]

#for s in ama:
#    GogoFire("/"+s)
    
ss = H.getNode("/min1")._v_children.keys()
for s in ss:
    GogoFire("/min1/"+s)

H.close()
